package com.tongzhan.controller;

import com.tongzhan.base.Return;
import com.tongzhan.service.DateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RequestMapping("/date")
@RestController
public class DateController {

    @Autowired
    private DateService dateService;

    /**
     * 获取大屏年度
     * @return
     */
    @RequestMapping("/getYearData")
    public Return getYearData() {
        Map<String, Object> map = dateService.getYearData();
        return Return.getSuccessResult(map);
    }

    /**
     * 获取大屏半年度
     * @return
     */
    @RequestMapping("/getHalfYearData")
    public Return getHalfYearData() {
        Map<String, Object> map = dateService.getHalfYearData();
        return Return.getSuccessResult(map);
    }

    /**
     * 获取大屏季度
     * @return
     */
    @RequestMapping("/getSeasonData")
    public Return getSeasonData() {
        Map<String, Object> map = dateService.getSeasonData();
        return Return.getSuccessResult(map);
    }

    /**
     * 获取大屏月度
     * @return
     */
    @RequestMapping("/getMonthData")
    public Return getMonthData() {
        Map<String, Object> map = dateService.getMonthData();
        return Return.getSuccessResult(map);
    }
}
